<template>
  <router-view @click.prevent="handclick">
  </router-view>
</template>
<script>
export default {
  name: 'App',
  methods: {
    //全屏模式
    handclick(){
      let lastTime = 0;
    document.addEventListener('click', () => {
      let nowTime = new Date().getTime(); 
      if (nowTime - lastTime < 500) { 
        this.requestFullScreen();
      }
      lastTime = nowTime; 
    });
    },
    requestFullScreen() {
      let element = document.documentElement;
      if (element.requestFullscreen) {
        element.requestFullscreen();
      } else if (element.mozRequestFullScreen) { 
        element.mozRequestFullScreen();
      } else if (element.webkitRequestFullscreen) { 
        element.webkitRequestFullscreen();
      } else if (element.msRequestFullscreen) { 
        element.msRequestFullscreen();
      }
    }
  }
};
</script>
<style scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
